<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
		<title>填写信用卡信息</title>
		<link rel="stylesheet" type="text/css" href="css/public.css"/>
	</head>
	<style type="text/css">
		/*移动端1px下边线*/
		.border{ position: relative; }
		.border:after{ content: ''; display:block; position: absolute; width: 100%; left: 0px; bottom: 0px;height: 1px; background-color:  #efefef; -webkit-transform: scaleY(0.5); transform: scaleY(0.5);}
		.lable{height: 0.88rem;font-size: 0.28rem;padding-left: 0.4rem;}
		.item{height: 1.1rem;background: #fff;font-size: 0.3rem;font-weight: bold;}
		.item p{margin-left: 0.4rem;}
		.item input{margin-left: 0.5rem;font-size: 0.3rem;}
		.item img{width: 0.43rem;height: auto;margin-left: 0.7rem;}
		.confirm{height: 0.88rem;width: 6.8rem;margin: 0.52rem auto;font-size: 0.3rem;background: #0D6FB8;border-radius: 5px;color: #fff;cursor: pointer;}
		.container a{color: #0d6fb8;font-size: 0.26rem;display: block;margin-top: 0.2rem;margin-left: 5.5rem;text-decoration: underline;}
	</style>
	<body>
		<!--头部header开始-->
		<header class="flex flex-align-center">
			<div class="left flex flex-align-center" onclick="Util.back()">
				<img src="img/arrleft.png" alt="" class="arrleft"/>
			</div>
			<div class="title">填写信用卡信息</div>
			<div class="right flex flex-pack-center flex-align-center">
				<img src="img/interrogation.png" onclick="Util.jump('http://www.uniao.me/help/index.html?type=creditCard')"/>
			</div>
		</header><!--头部header结束-->
		<!--内容开始-->
		<div class="container">
			<div class="lable flex flex-align-center"><p>请选择持卡人本人信用卡</p></div>
			<div class="item flex flex-align-center border">
				<p>持卡人：</p>
				<input type="text"  id='userName' readOnly='readOnly'/>
				<img src="img/warning.png" alt="" onclick="openWin()"/>
			</div>
			<div class="item flex flex-align-center">
				<p>卡号：</p>
				<input type="number" style="margin-left: 0.8rem;" placeholder="请输入信用卡卡号" id="bankCard"/>
			</div>
			<a href="http://www.uniao.me/help/support-bank.html">支持的银行卡？</a>
			<div class="confirm flex flex-align-center flex-pack-center" onclick="jump()"><p>下一步</p></div>
		</div><!--内容结束-->
	</body>
	<script type="text/javascript" src="js/rem.js"></script>
	<script type="text/javascript" src="js/zepto.js"></script>
	<script type="text/javascript" src="js/template.js"></script>
	<script type="text/javascript" src="js/api.js"></script>
	<script type="text/javascript" src="js/layer.js"></script>
	<script type="text/javascript" src="js/common.js"></script>
	<script type="text/javascript">
		function jump(){
			if($('#bankCard').val()==''){
				layer.open({
						content: '请输入卡号',
						skin: 'msg',
						time: 2 //2秒后自动关闭
					});	
			}else if($('#bankCard').val().length<16){
				layer.open({
						content: '卡号至少16位',
						skin: 'msg',
						time: 2 //2秒后自动关闭
					});	
			}else{
				Public.getBankInfo({
					bankno: $('#bankCard').val(),
					isCredit: true //新增参数
				},function(res){
					localStorage.bankName = res.data.bankName;// 缓存银行名称
					localStorage.bankId = res.data.id;// 缓存银行id
					localStorage.shortName = res.data.shortName;// 缓存银行名称简写
					localStorage.acctNo = $('#bankCard').val();// 缓存当前输入的银行卡卡号
					Util.jump('fillInBankCredit.html');
				});
			}
		}
		function openWin(){
			layer.open({
			    content: '此信用卡为通道付款银行卡，为了资金安全，只能绑定当前持卡人的信用卡'
			    ,btn: '我知道了'
			  });
		}
		$(function(){
			$('#userName').val(localStorage.userName);
		})
	</script>
</html>
